/*********************************************************************
* File: state.h
* Declare properties and methods of State
* Is is abstract class
* Author: 10520418 Bui Huu Hiep
**********************************************************************/
#pragma once
#ifndef _STATE_H
#define _STATE_H

#include <d3d9.h>
#include <d3dx9.h>
#include "Resources.h"
#include "dsutil.h"
#include "Input.h"
/*******************
* GameState
* ID of State
*******************/
enum GameState
{
	ST_Menu,
	ST_Play,
	ST_Continues,
	ST_Option,
	ST_About,
	ST_Exit
};

/***********************************************
* State
* Declare properties and methods of State
* Is is abstract class
***********************************************/
class State
{
protected:
	GameState				_current_state;
	GameState				_next_state;

	bool					_close;
	Resources*				_resources;
	LPDIRECT3DSURFACE9		_background;

public:
	State(Resources* res)
	{
		_resources = res;
		_close = false;
	}
	~State(void)
	{
		
	}

	GameState CurrentState() { return _current_state; }
	GameState NextState() { return _next_state; }
	void SetNextState(GameState val) { _next_state = val; }
	bool IsClose() { return _close; }
	void Close(bool value) { _close = value; }

	virtual void Update(float time) = 0;
	virtual void ProcessInput(Input* input) = 0;
	virtual void Render(LPD3DXSPRITE spriteHandler) = 0;
	virtual void Release() = 0;
};
#endif
